#include <vector>
#include <sstream>
#include <iostream>
#include <set>

int main()
{
    int N, M, k;
    std::cin >> N;
    std::cin >> M;
    std::cin.ignore();

    std::set<int> die;
    int num;
    std::string s;
    std::getline(std::cin, s);
    std::istringstream iss(s);
    while (iss >> num)
    {
        die.insert(num);
    }

    std::cin >> k;

    int max_v = 0;
    int left = 1;
    int right = 1;
    int useK = 0;
    while (right <= N)
    {
        if (die.count(right) == 1)
        {
            useK++;
        }
        if (useK > k)
        {
            while (die.count(left) == 0)
            {
                left++;
            }
            left++;
            useK--;
        }
        max_v = max_v < (right - left + 1) ? (right - left + 1) : max_v;
        right++;
    }

    std::cout << max_v << std::endl;
    return 0;
}